<?php
// loading the header
if (isset($header) && is_array($header)) {
  $this->load->view('pages/header',$header);
}
else {
  $this->load->view('pages/header');
}
?>

<div class="row">

  <div class="eleven columns content-container">
    <?php if(isset($page_h1)): ?>
    <h2 id="page-title" class="page-title"><?php echo $page_h1; ?></h2>
    <?php endif; ?>

    <?php
    // checking if a view is defined
    if (isset($content['view'])) {
      //checking if data is passed to the view
      if (isset($content['data']) && is_array($content['data'])) {
        $this->load->view($content['view'], $content['data']);
      }
      else {
        $this->load->view($content['view']);
      }
    }
    ?>
  </div>

  <div class="five columns" id="sidebar-container">
    <?php
    // calling the info block
    $this->load->view('blocks/myinfo_block_view');

    // subscriber block
    $this->load->view('blocks/subscriber_view');

    // calling the google search view
    $this->load->view('blocks/google_search_view');

    // calling the block for latest web articles
    $block_data['data'] = $this->blocks_model->get_block('latest_web');
    $this->load->view('blocks/latest_web_view',$block_data);

    // calling the block for the latest trip logs
    $block_data['data'] = $this->blocks_model->get_block('latest_triplogs');
    $this->load->view('blocks/latest_triplog_view',$block_data);

    // micro blog posts are not converted. Will post and activate this.
    // $block_data['data'] = $this->blocks_model->get_block('latest_triplogs');
    // $this->load->view('blocks/latest_triplog_view',$block_data);

    // getting the twitter block
    $this->load->view('blocks/twitter_block_view');
    ?>
  </div>

</div>

<?php
// loading the footer
if (isset($footer) && is_array($footer)) {
  $this->load->view('pages/footer',$footer);
}
else {
  $this->load->view('pages/footer');
}
?>